<template>
    <h1>用户列表</h1>

    <table>
        <thead>
            <tr>
                <th>登录名称</th>
                <th>登录密码</th>
                <th>真实姓名</th>
                <th>身份证号</th>
                <th>联系方式</th>
                <th>出生日期</th>
                <th>性别</th>
                <th>用户类型</th>
                <th>年收入</th>
            </tr>
        </thead>

        <tbody>
            <tr v-for="item in Show" >
                <td>{{ item.UL_Name }}</td>
                <td> ****** </td>
                <td>{{ item.UT_Name }}</td>
                <td>{{ item.U_Name }}</td>
                <td>{{ item.U_Phone }}</td>
                <td>{{ item.U_IdCard }}</td>
                <td>{{ item.U_Date }}</td>
                <td>{{ Boolean(item.U_Sex) ==true?'男':'女'  }}</td>
                <td>{{ item.U_money }}</td>
            </tr>
        </tbody>

    </table>

</template>

<script setup lang="ts">

import {ref,onMounted} from 'vue';
import axios from 'axios';

const Show = ref([{
    UL_Name:'',
    UL_Pwd:'',
    UT_Name:'',
    U_Name:'',
    U_Phone:'',
    U_IdCard:'',
    U_Date:'',
    U_Sex:'',
    U_money:''
}])

onMounted (()=>{
    axios({
        url:'http://localhost:56707/api/User/UserDataShow',
        method:'get',
    })
    .then((res)=>{
        Show.value = res.data;
    })
    .catch((err)=>{
        console.log(err);
    })
})



</script>
